/**
 * 用户类型枚举
 */
class UserTypeEnum {
    code
    desc
    constructor(code, desc) {
        this.code = code
        this.desc = desc
    }
}

/**
 * 枚举类对象
 *
 * @type {{REGULATOR: UserTypeEnum, COMMON: UserTypeEnum, ADMIN: UserTypeEnum}}
 */
const userType = {
    ADMIN: new UserTypeEnum("admin", "系统用户"),
    REGULATOR: new UserTypeEnum("regulator", "监管者"),
    COMMON: new UserTypeEnum("common", "普通用户")
}

// 设置当前对象只读
Object.freeze(userType)
// 冻结对象属性,防止被修改
for (const [,value] of Object.entries(userType)) {
    Object.freeze(value)
}

export {
    userType,
}
